{template 'common/header'}

<ul class="nav nav-tabs">
	<li  class="active"><a
		href="{php echo $this->createWebUrl('OrderManager', array('hid'=>$hid));}">报名管理</a></li>
	<li><a href="{php echo $this->createWebUrl('houseSetting');}">楼盘管理</a></li>

</ul>



<div class="main">
	
	
		<div style="padding: 0 15px 0 15px; margin-top: 10px">
		<div class="row-fluid">
			<div class="span8 control-group">


			<a class="btn"
					href="{php echo $this->createWebUrl('OrderDowload', array( 'name' => 'mon_house','hid'=>$hid))}"><i
					class="icon-download-alt"></i>报名信息导出</a>
			</div>
		</div>

	</div>
	
	
	




<div style="padding: 15px;">
		<table class="table table-hover">
			<thead class="navbar-inner">
				<tr>
					<th>姓名</th>
					<th>电话</th>
					<th>报名时间</th>



					<th style="text-align: right;">操作</th>
				</tr>
			</thead>
			<tbody>
				{loop $list $item}
				<tr>

					<td>{$item['uname']}</td>
					<td>{$item['tel']}</td>

					<td>{php echo date('Y-m-d  H:i', $item['createtime'])}</td>
							
							
						

					<td style="text-align: right;">
					

				 <a
						href="{php echo create_url('site/module/OrderManager', array('name' => 'mon_house', 'id' => $item['id'],'hid'=>$hid, 'op' => 'delete'))}"
						onclick="return confirm('此操作不可恢复，确认删除？');return false;" title="删除"
						class="btn btn-small"><i class="icon-remove"></i></a></td>
				</tr>
				{/loop}

			</tbody>
		</table>
		{$pager}
	</div>

	
		
		
		
		
		

</div>



<!-- Modal -->
<div id="detialDialog" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h3 id="myModalLabel">订单详细查看</h3>
  </div>
  <div class="modal-body">
   	
  </div>
  <div class="modal-footer">
    <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
    <button class="btn btn-primary" id="gift_save">保存</button>
  </div>
</div>




<script>

function orderDetail(oid){
	
	$(".modal-body").load("{php echo create_url('site/module/OrderDetail', array('name' => 'carmaintenance'))}&oid="+oid);
	
	
	$("#detialDialog").modal('show');
	
	
}


	$(function(){
		
		getSerices($("#bid").val());
		
		getModels($("#sid").val());
		$("#bid").change(function(){
			
			var bid=$(this).val();
		
			getSerices(bid);
			
		});
		
		
		
	$("#sid").change(function(){
			
			var sid=$(this).val();
		
			getModels(sid);
			
		});
		
		
		
		function getSerices(bid){
			
			var $sid=$("#sid");
			
			var checkSid="{$sid}";
			$.get('{php echo create_url('site/module/QuerySeriesByBid', array('name' => 'carmaintenance'));}',{"bid":bid},function(res){
				
				var opHtml="<option value=''>全部</option>";
					for(var i=0;i<res.length;i++){
						
						var series=res[i];
						
						if(i==0){
							getModels(series['id']);
						}
						
						if(series['id']==checkSid){
							opHtml+="<option value="+series['id']+" selected='selected' >"+series['sname']+"</option>";
						}else{
							opHtml+="<option value="+series['id']+">"+series['sname']+"</option>";
						}
						
						
						
					}
					
					$sid.html(opHtml);
				
				
			},'json');
			
		}
		
		
		/**
		*	获取模型
		*/
		function getModels(sid){
			
			var checkMid="{$mid}";
			$.get('{php echo create_url('site/module/QueryModelBySid', array('name' => 'carmaintenance'));}',{"sid":sid},function(res){
				
				var opHtml="<option value=''>全部</option>";
					for(var i=0;i<res.length;i++){
						
						var model=res[i];
						
						
						if(model['id']==checkMid){
							opHtml+="<option value="+model['id']+" selected='selected' >"+model['mname']+"</option>";
						}else{
							opHtml+="<option value="+model['id']+">"+model['mname']+"</option>";
						}
						
					}
					
					$("#mid").html(opHtml);
				
				
			},'json');
			
			
		}
		
		
		
		
	});
</script>
 {template 'common/footer'}
